<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>localComponent</title>
    </head>
    <body>
        <!-- 局部组件 -->
        <div id = "app">
            <jbcomponent></jbcomponent>       
            <jbcomponent></jbcomponent>
            <jbcomponent></jbcomponent>
        </div>
        <script src = "../../vue.min.js"></script>
        <script>

            var data={
                counter:0
            }
            
            var app = new Vue({
                el:'#app',
                // 局部注册写在构造器里面且是components加了s
                components:{
                    "jbcomponent":{
                        /*counter++ 字体应该是黄色的*/
                        template:'<button @Click="counter++">{{counter}}</button>',
                        data:function () {
                            return data;
                        }
                    }
                }
            })
        </script>
    </body>
</html>